<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace AlibabaCloud\Client;

function inOpenBasedir($filename, $throwException = false)
{
    $open_basedir = ini_get("open_basedir");
    if(!$open_basedir) {
        return true;
    }
    $dirs = explode(PATH_SEPARATOR, $open_basedir);
    if(empty($dirs)) {
        return true;
    }
    if(inDir($filename, $dirs)) {
        return true;
    }
    if($throwException === false) {
        return false;
    }
    throw new Exception\ClientException("open_basedir restriction in effect. " . "File(" . $filename . ") is not within the allowed path(s): (" . $open_basedir . ")", "SDK.InvalidPath");
}
function inDir($filename, array $dirs)
{
    foreach ($dirs as $dir) {
        if(!\Stringy\Stringy::create($dir)->endsWith(DIRECTORY_SEPARATOR)) {
            $dir .= DIRECTORY_SEPARATOR;
        }
        if(0 === strpos($filename, $dir)) {
            return true;
        }
    }
    return false;
}
function isWindows()
{
    return PATH_SEPARATOR === ";";
}
function cliMate()
{
    return new \League\CLImate\CLImate();
}
function backgroundRed($string, $flank = NULL, $char = NULL, $length = NULL)
{
    cliMate()->br();
    if($flank !== NULL) {
        cliMate()->backgroundRed()->flank($flank, $char, $length);
        cliMate()->br();
    }
    cliMate()->backgroundRed($string);
    cliMate()->br();
}
function backgroundGreen($string, $flank = NULL, $char = NULL, $length = NULL)
{
    cliMate()->br();
    if($flank !== NULL) {
        cliMate()->backgroundGreen()->flank($flank, $char, $length);
    }
    cliMate()->backgroundGreen($string);
    cliMate()->br();
}
function backgroundBlue($string, $flank = NULL, $char = NULL, $length = NULL)
{
    cliMate()->br();
    if($flank !== NULL) {
        cliMate()->backgroundBlue()->flank($flank, $char, $length);
    }
    cliMate()->backgroundBlue($string);
    cliMate()->br();
}
function backgroundMagenta($string, $flank = NULL, $char = NULL, $length = NULL)
{
    cliMate()->br();
    if($flank !== NULL) {
        cliMate()->backgroundMagenta()->flank($flank, $char, $length);
    }
    cliMate()->backgroundMagenta($string);
    cliMate()->br();
}
function json(array $array)
{
    cliMate()->br();
    cliMate()->backgroundGreen()->json($array);
    cliMate()->br();
}
function redTable($array)
{
    cliMate()->redTable($array);
}
function block($result, $title)
{
    cliMate()->backgroundGreen()->flank($title, "--", 20);
    dump($result);
}
function env($key, $default = NULL)
{
    $value = getenv($key);
    if($value === false) {
        return value($default);
    }
    if(envSubstr($value)) {
        return substr($value, 1, -1);
    }
    return envConversion($value);
}
function envConversion($value)
{
    $key = strtolower($value);
    if($key === "null" || $key === "(null)") {
        return NULL;
    }
    $list = ["true" => true, "(true)" => true, "false" => false, "(false)" => false, "empty" => "", "(empty)" => ""];
    return isset($list[$key]) ? $list[$key] : $value;
}
function envNotEmpty($key)
{
    $value = env($key, false);
    if($value !== false && !$value) {
        throw new Exception\ClientException("Environment variable '" . $key . "' cannot be empty", SDK::INVALID_ARGUMENT);
    }
    if($value) {
        return $value;
    }
    return false;
}
function envSubstr($value)
{
    return 1 < ($valueLength = strlen($value)) && strpos($value, "\"") === 0 && $value[$valueLength - 1] === "\"";
}
function value($value)
{
    return $value instanceof \Closure ? $value() : $value;
}

?>